package com.rtx.edi.platform.source.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rtx.api.annotation.DataSourceAnnotation;
import com.rtx.edi.platform.source.bean.PlExpressSourceData;
import com.rtx.edi.platform.source.mapper.PlExpressSourceDataMapper;
import com.rtx.edi.platform.source.service.PlExpressSourceDataService;

@Service
public class PlExpressSourceDataServiceImpl extends ServiceImpl<PlExpressSourceDataMapper, PlExpressSourceData> implements PlExpressSourceDataService{

	@Override
	public void selectList(Page<PlExpressSourceData> pageParam, PlExpressSourceData po) {
        LambdaQueryWrapper<PlExpressSourceData> query = Wrappers.lambdaQuery();
        query.eq(po.getName() != null,PlExpressSourceData::getName, po.getName())
                .like(po.getCode() != null, PlExpressSourceData::getCode, po.getCode());
        baseMapper.selectPage(pageParam,query);
	}

	@Override
	public void addData(String datasourckey,PlExpressSourceData dto) {
		baseMapper.insert(dto);
	}
}
